package com.kylin.domain.oauth2.social;

import com.kylin.domain.user.vo.WechatUserInfoVO;
import lombok.EqualsAndHashCode;
import org.springframework.security.authentication.AbstractAuthenticationToken;

/**
 * 微信用户登录Token
 * @author Damon S.
 * @version v1.0.1
 * @date 2021年01月10日 14:54
 */
@EqualsAndHashCode(callSuper = true)
public class WechatOauthAuthenticationToken extends AbstractAuthenticationToken {

    private final WechatUserInfoVO userInfoVO;

    public WechatOauthAuthenticationToken(WechatUserInfoVO userInfo) {
        super(null);
        this.userInfoVO = userInfo;
        this.setAuthenticated(true);
    }

    @Override
    public Object getCredentials() {
        return null;
    }

    @Override
    public Object getPrincipal() {
        return userInfoVO;
    }
}
